package com.bluesea.report.service.integral.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.bluesea.report.dao.IntegralDao;
import com.bluesea.report.entity.Integral;
import com.bluesea.report.service.integral.IIntegralService;

@Service("integralServiceImpl")
public class IntegralServiceImpl implements IIntegralService {
	
	@Resource
	private IntegralDao integralDao;

	@Override
	public List<Integral> getIntegralAll() {
		List<Integral> integralList = new ArrayList<Integral>();
		try {
			integralList = integralDao.getIntegralAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return integralList;
	}

	@Override
	public List<Integral> query(Map<String, Object> params) {
		Integral integral = JSON.parseObject(JSON.toJSONString(params), Integral.class);
		List<Integral> integralList = new ArrayList<Integral>();
		try {
			integralList = integralDao.query(integral);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return integralList;
	}

}
